<?php

namespace App\Http\Resources\Trip\Orders;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
use JsonSerializable;

class OrderListPassengersResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param Request $request
     *
     * @return array|Arrayable|JsonSerializable
     */
    public function toArray($request)
    {
        $passenger = parent::toArray($request);
        if (isset($passenger['seat_no'])) {
            $passenger['seat_no_uy'] = $passenger['seat_no'] ? trans2uy($passenger['seat_no']) : "";
        }
        unset($passenger['order_sn']);
        return $passenger;
    }
}
